stop_machine: fill fn_result only in case of error
authorGregory Herrero <gregory.herrero@oracle.com>
Thu, 1 Jun 2017 08:53:04 +0000 (10:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 1 Jun 2017 08:53:04 +0000 (10:53 +0200)
commitd8b833d78f6bfde9855a949b5e6d3790d78c0fb7
treea1b9a64ca8e8fed6dda355024f15fccebc856451
parentd6d6e4a19dc16f6d82ab9dec0f177f2105ab97ac
stop_machine: fill fn_result only in case of error

When stop_machine_run() is called with NR_CPUS as last argument,
fn_result member must be filled only if an error happens since it is
shared across all cpus.

Assume CPU1 detects an error and set fn_result to -1, then CPU2 doesn't
detect an error and set fn_result to 0. The error detected by CPU1 will
be ignored.

Note that in case multiple failures occur on different CPUs, only the
last error will be reported.

Signed-off-by: Gregory Herrero <gregory.herrero@oracle.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/common/stop_machine.c